home *** CD-ROM | disk | FTP | other *** search
- {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
- The purchaser of these procedures and functions may include them in COMPILED
- programs freely, but may not sell or give away the source text.
-
- Programs INCLUDEing this file must also INCLUDE
- FILENAME.TYP
- REGPACK.TYP
-
- The procedure MOVE is the DOS 2.0 RENAME command. It can actually
- MOVE a file from one subdirectory to another! The file can be
- renamed in the process, and any file in any subdirectory can be
- renamed without being moved.
-
- }
- {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
- procedure MOVEFILE ( VAR OldFullPath :filename_type;
- VAR NewFullPath : filename_type;
- VAR error_return : byte);
-
- var
- regs : regpack;
- N : byte;
-
- begin
- OldFullPath[length(OldFullPath)+1] := chr(0);
- NewFullPath[length(NewFullPath)+1] := chr(0);
- with regs do
- begin
- DS := seg(OldFullPath);
- DX := ofs(OldFullPath)+1; {the very first byte is the length}
- ES := seg(NewFullPath);
- DI := ofs(NewFullPath)+1;
- AX := $56 shl 8; { ERRORS are }
- INTR($21,regs); { 2 : file not fount }
- if Flags and 1 = 1 then { 3 : path not found }
- error_return := AX { 5 : access denied }
- else { 17 : not same device }
- error_return := 0;
- end; {with}
- end;